﻿<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
  <database-object>
    <create>
      ALTER TABLE AF_TOPICS DROP CONSTRAINT FK_Topics_Update
    </create>
    <drop></drop>
  </database-object>
  <database-object>
    <create>      
      ALTER TABLE AF_TOPICS ADD CONSTRAINT FK_Topics_Update FOREIGN KEY (UpdateId) REFERENCES AF_UPDATE ON DELETE CASCADE      
    </create>
    <drop></drop>
  </database-object>
  <database-object>
    <create>      
      ALTER TABLE AF_COMMENTS DROP CONSTRAINT FK_Comments_Update      
    </create>
    <drop></drop>
  </database-object>
  <database-object>
    <create>      
      ALTER TABLE AF_COMMENTS ADD CONSTRAINT FK_Comments_Update FOREIGN KEY (UpdateId) REFERENCES AF_UPDATE ON DELETE CASCADE      
    </create>
    <drop></drop>
  </database-object>
  <database-object>
    <create>
      ALTER TABLE AF_USERGROUPS DROP CONSTRAINT FK_UserGroups_Update
    </create>
    <drop></drop>
  </database-object>
  <database-object>
    <create>      
      ALTER TABLE AF_USERGROUPS ADD CONSTRAINT FK_UserGroups_Update FOREIGN KEY (UpdateId) REFERENCES AF_UPDATE ON DELETE CASCADE      
    </create>
    <drop></drop>
  </database-object>
  <database-object>
    <create>      
      ALTER TABLE AF_LIKES DROP CONSTRAINT FK_Likes_Update      
    </create>
    <drop></drop>
  </database-object>
  <database-object>
    <create>      
      ALTER TABLE AF_LIKES ADD CONSTRAINT FK_Likes_Update FOREIGN KEY (UpdateId) REFERENCES AF_UPDATE ON DELETE CASCADE
    </create>
    <drop></drop>
  </database-object>
</hibernate-mapping>